package com.example.designpatterns.behavioral.mediator;

/**
 * 实现具体同事类1
 *
 * @author scott
 */
public class ConcreteColleague1 implements Colleague {

    private Mediator mediator;

    public ConcreteColleague1(Mediator mediator) {
        this.mediator = mediator;
    }

    @Override
    public void sendMessage(String message) {
        mediator.sendMessage(message, this);
    }

    @Override
    public void receiveMessage(String message) {
        System.out.println("Colleague1 received message: " + message);
    }

}